class CreateInstallations < ActiveRecord::Migration
  def self.up
    create_table :installations do |t|
      t.integer :enterprise_id
      t.string :installer_full_name
      t.integer :order_item_id
      t.integer :has_been_sent_to_installer_count, :default => 0
      t.integer :installed_count, :default => 0
      t.integer :after_serviced_count, :default => 0
      t.integer :feed_id
      t.date :installed_on
      t.string :liable_side, :default => '厂家'
      t.decimal :after_serviced_cost,:precision => 8, :scale => 2, :default => 0
      t.decimal :gathered_balance,:precision => 8, :scale => 2, :default => 0
      t.text :remark,
        :after_serviced_remark,
        :installed_remark
      t.integer :updated_by_user_id
      t.timestamps
    end
  end

  def self.down
    drop_table :installations
  end
end
